﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using zhwy.saas.api.Models;

namespace zhwy.saas.api.Controllers
{
    [ApiController]
    [Route("api/v{version:apiVersion}/[controller]")]
    public class EmptyBaseController : ControllerBase
    {

        protected ApiResponseModel<T> GetResponseModel<T>(T data)
        {
            return new ApiResponseModel<T>
            {
                Code = 200,
                Message = "成功",
                Data = data,
                Success = true
            };
        }

        protected ApiResponseModel<T> GetResponseErrorModel<T>(T data, int code = 500, string msg = "")
        {
            return new ApiResponseModel<T>
            {
                Code = code,
                Message = "失败",
                Data = default,
                Success = false
            };
        }
    }
}
